using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using JUtil;
using JUtil.ResourceManagement;
using JUtil.Web;

namespace ABCD
{
    [DataObject(true)]
    public class EE : BLL<FF>
    {
        #region GetOrderBy
        protected override string GetOrderBy()
        {
			string orderBy = SqlFile.GetSQL("GetOrderBy");
			
			return orderBy;
        }
        #endregion

        #region GetSelectSQLNoOrderBy
        protected override string GetSelectSQLNoOrderBy(Hashtable Parameters)
        {
			string sql = SqlFile.GetSQL("GetSelectSQLNoOrderBy",
							Convert.ToString(Parameters["AA"]),
							Convert.ToString(Parameters["BB"]));
			
			return sql;
        }
        #endregion

        #region GetSelectDetailsVwSQL
        protected override string GetSelectDetailsVwSQL(Hashtable Parameters)
        {
			throw new NotImplementedException();
        }
        #endregion

        #region GetInsertSQL
        public override List<string> GetInsertSQL(FF aRec)
        {
			throw new NotImplementedException();
        }
        #endregion

        #region GetUpdateSQL
        public override List<string> GetUpdateSQL(FF aRec)
        {
			throw new NotImplementedException();
        }
        #endregion

        #region GetDeleteSQL
        public override List<string> GetDeleteSQL(FF aRec)
        {
			List<string> lst = new List<string>();
			
			string sql = SqlFile.GetSQL("GetDeleteSQL");
			
			FF newValue =  aRec;
			// 來自GridView執行刪除動作沒有執行SelectDetail操作，因此沒有OldRec
			FF oldValue = aRec;
			
			sql = Formatter.GenericFormat<FF>(DatabaseType.SqlServer, 
													 sql, 
													 newValue, 
													 oldValue);
			
			lst.Add(sql);
			
			return lst;
        }
        #endregion

        #region CreateDbObject
        protected override IDbBasicOp CreateDbObject()
        {
            return new Database(DbProvider.OleDb, @"Provider=SQLOLEDB.1;Password=sapass;Persist Security Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=JELLY\SQLEXPRESS");
        }
        #endregion

    }
}
